<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<LinQDemo.Models.Student>>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ListStudents</title>
</head>
<body>
        <table>
            <tr>
                <th></th>
                <th>
                    StudentID
                </th>
                <th>
                    StudentName
                </th>
                <th>
                    ClassID
                </th>
                <th>
                    Error
                </th>
            </tr>

        <% foreach (var item in Model) { %>
        
            <tr>
                <td>
                    <%= Html.ActionLink("Edit", "Edit", new { id=item.StudentID.Trim()  }) %> |
                </td>
                <td>
                    <%= Html.Encode(item.StudentID) %>
                </td>
                <td>
                    <%= Html.Encode(item.StudentName) %>
                </td>
                <td>
                    <%= Html.Encode(item.ClassID) %>
                </td>
            </tr>
        
        <% } %>

        </table>

        <p>
                <%= Html.ActionLink("View Students and Teacher", "ListStudentClassTeacher")%>

        </p>
         <p>
                <%= Html.ActionLink("Add Student", "Add")%>

        </p>
         <p>
                <%= Html.ActionLink("View Student By Class", "ListStudentByClass")%>

        </p>
</body>
</html>

